﻿@model ContactUsModel
@using SmartStore.Web.Models.Common;
@{
    Layout = "_Layout";

    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : T("PageTitle.ContactUs").Text);
    Html.AddMetaDescriptionParts(Model.MetaDescription);
    Html.AddMetaKeywordParts(Model.MetaKeywords);
}

<div class="page contact-page">
	<div class="page-title">
		<h1 class="h2">@T("PageTitle.ContactUs")</h1>
	</div>

    @{ Html.RenderAction("TopicBlock", "Topic", new { systemName = "ContactUs", isLead = true, bodyOnly = true }); }

    <div class="page-body">

        @{ Html.RenderWidget("contactus_top"); }

        @if (Model.SuccessfullySent)
        {
            <div class="alert alert-success">
                @Model.Result
            </div>        
		}
		else
		{
			using (Html.BeginRouteForm("ContactUs", FormMethod.Post, new { @class = "contact-form" }))
			{
				if (!ViewData.ModelState.IsValid)
				{
					@Html.ValidationSummary(false)
				}

				if (this.EnableHoneypotProtection)
				{
					<div class="d-none">
						@Html.HoneypotField()
					</div>
				}

				@Html.ControlGroupFor(model => model.FullName, required: Model.FullNameRequired, breakpoint: "sm")
				@Html.ControlGroupFor(model => model.Email, required: true, breakpoint: "sm")
				
				<div class="form-group row">
					@Html.LabelFor(model => model.Enquiry, new { @class = "col-sm-3 col-form-label required" })
					<div class="col-sm-9">
						@Html.TextAreaFor(model => model.Enquiry, new { @class = "form-control", rows = "6", placeholder = T("ContactUs.Enquiry.Hint") })
						@Html.ValidationMessageFor(model => model.Enquiry)
					</div>
				</div>

                <div class="form-group row">
                    <div class="col col-sm-auto offset-sm-3 text-muted">
                        @T("Common.FormFields.Required.Hint")
                    </div>
                </div>

				<div class="row justify-content-end">
					<div class="col-sm-9">
						@{ Html.RenderWidget("gdpr_consent"); }
					</div>
				</div>
				
				if (Model.DisplayCaptcha)
				{
					<div class="form-group row">
						<div class="col col-sm-auto offset-sm-3 captcha-box">
							@Html.Raw(Html.GenerateCaptcha())
						</div>
					</div>
				}
                
				<div class="form-group row">
					<div class="col col-sm-auto offset-sm-3">
						<button type="submit" name="send-email" class="btn btn-primary btn-lg btn-block">
							@T("ContactUs.Button")
						</button>
					</div>
				</div>
            }
        }

        @{ Html.RenderWidget("contactus_bottom"); }

    </div>
</div>
